This table shows the sizes and alignment of C data types. Since the size of signed and unsigned types is the same, they are not shown.
Data type |
Size (bytes) |
Alignment |
Notes |
bool |
1 |
1 |
|
char |
1 |
1 |
Source and execution character sets are standard ASCII. |
short |
2 |
2 |
Integer is converted into short form by truncation. |
int |
4 |
4 |
|
long |
4 |
4 |
|
long long |
8 |
8 |
|
float |
4 |
4 |
Exponent :
8 bits, mantissa 23. |
double |
8 |
8 |
Exponent :
11 bits, mantissa 52. |
long double |
12 |
8 |
Exponent :
15 bits mantissa 63 |
pointer |
4 |
4 |
The difference of two pointers is an int. |
T[n] (Array) |
n * sizeof T |
Same as T |
|
Enums |
4 |
4 |
Enums are implemented as ints. |
The compiler creates segments for code, data, and uninitialized data. The segments (or sections, in COFF terminology) are the following:
·
The code section
stores the executable statements.
·
The initialized
data section stores all literal constants
·
The uninitialized
data section (bss) is initialized to zero by the operating system.
The format of the debug information generated is compatible with the NB09 standard as published by Microsoft and Intel Corporations. Any debugger that understands that format can be used with the generated code.